package com.xhorse.lockplatform.comm.exception;


import com.xhorse.lockplatform.comm.enums.ResultEnum;

/**
 * @author Tom
 */
public class LockPlatFormException extends RuntimeException {

    private String code;
    private String message;

    public LockPlatFormException(ResultEnum codeEnum) {
        super(codeEnum.getMsg());
        this.code = codeEnum.getCode();
        this.message = codeEnum.getMsg();
    }

    public LockPlatFormException(ResultEnum codeEnum, Throwable cause) {
        super(codeEnum.getMsg(), cause);
        this.code = codeEnum.getCode();
        this.message = codeEnum.getMsg();
    }

    public LockPlatFormException(String code, String message) {
        super(message);
        this.code = code;
        this.message = message;
    }

    public LockPlatFormException(String code, String message, Throwable cause) {
        super(message, cause);
        this.code = code;
        this.message = message;
    }

    public String getCode() {
        return code;
    }

    @Override
    public String getMessage() {
        return message;
    }


}
